<%@page pageEncoding="UTF-8" contentType="text/html;charset=utf-8" errorPage="/commons/error.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='zh-CN' xml:lang='zh-CN' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>订单</title>
<style type="text/css">
table{font-size: 12px;}
</style>
</head>
<body>
<form:form id="form" class="form-inline" commandName="orderQuery" action="${ctx}/admin/order/list" method="post">
<div class="form-group">
  <label for="order_status">状态</label>
  <div>
  <form:select id="order_status" path="order_status" class="form-control padding">
  	<option></option>
  	<form:options items="${order_status}" itemLabel="description" />
  </form:select>
  </div>
</div>
<div class="form-group">
	<label for="order_group_id">GroupID</label>
	<div>
		<form:input path="order_group_id" id="order_group_id" class="form-control width-180" placeholder="订单组id" />
	</div>
</div>
<div class="form-group">
	<label for="id">ID</label>
	<div>
		<form:input path="id" id="id" class="form-control width-180" placeholder="订单id" />
	</div>
</div>
<div class="form-group">
	<label for="user_name">用户名/手机号</label>
	<div>
		<form:input path="user_name" id="user_name" class="form-control width-140" placeholder="用户名" />
	</div>
</div>

<div class="form-group">
	<label> </label>
	<div>
		<button type="submit" class="btn btn-primary">查询</button>
	</div>
</div>
<table class="table table-striped">
	<thead>
		<tr>
			<th>ID</th>
			<th>GroupID</th>
			<th>用户</th>
			<th>订单状态</th>
		    <th>商品名称</th>
		    <th>品类</th>
		    <th>规格</th>
		    <th>价格</th>
		    <th>数量</th>
		    <th>收件人</th>
		    <th>创建时间</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="item" items="${page.result}">
		<tr>
			<td><a href="${ctx}/admin/order/detail/${item.id}">${item.id}</a></td>
			<td>${item.order_group_id}</td>
			<td>${item.user_name}</td>
			<td>${item.order_status.description}</td>
			<td>${item.product_name}</td>
			<td>${item.catalog_name}</td>
			<td>${item.specification_name}</td>
			<td>${item.price}</td>
			<td>${item.quantity}</td>
			<td>${item.rec_name}</td>
			<td><fmt:formatDate value="${item.create_time}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
		</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="4">
				<jsp:include page="/commons/pager.jsp" />
			</td>
		</tr>
	</tfoot>
</table>
</form:form>
<script type="text/javascript" src="${ctx}/scripts/lottery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#nav_order").addClass("active");
	})
	
</script>
</body>
</html>